﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Collections.Generic;

namespace TripLOA.GUI.secure
{
    public partial class LastCreatedTrips : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            List<Stats.Objects.TripProperties> createdtrips = Groupware.TripManager.getLastTenCreatedTrips();

            if (!IsPostBack)
            {
                GridViewCreatedTrips.DataSource = createdtrips;
                GridViewCreatedTrips.DataBind();
            }

        }

        protected void GridViewCreatedTrips_RowCommand(object sender, EventArgs e)
        {
            GridViewRow row = (GridViewRow)((Control)((GridViewCommandEventArgs)e).CommandSource).Parent.Parent;
            LinkButton Hyperlink1 = (LinkButton)row.FindControl("TripDetail");

            TableCellCollection cell = row.Cells;
            string tripid = cell[0].Text;
            Session["tripid"] = tripid;
            Response.Redirect("../passengerTripDetail.aspx");
        }


    }
}
